package com.qf.controller;

import com.qf.service.ChapterService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 王希卓
 * @Date 2023/7/18 16:27
 * 课程章节
 */
@RestController
public class ChapterController {

    @Autowired
    private ChapterService chapterService;

    /**
     * 根据课程id查询所有章节
     * @param courseId 课程id
     * @return
     */
    @GetMapping("/chapter/findByCourseId")
    public ResultMsg findByCourseId(int courseId){
        return chapterService.findByCourseId(courseId);
    }
}
